#include <iostream>
#include <unistd.h>
#include <netinet/in.h>

#include "common.h"
#include "readConig.h"
#include "registrar.h"

using namespace std;

int main()
{
	char buff[512];
	int n = sprintf(buff, "hel\x75\x7e\x7eohello");

	registrar reg(4, 1); 	//第一个参数为节点号，第二个参数为程序号

	int listen_sockfd = reg.getSockFd(); 



	cout<<__func__<<endl;
	cout<<__TIME__<<endl;
	cout<<__FILE__<<endl;
	cout<<__DATE__<<endl;
	cout<<__LINE__<<endl;
	cout<<"\x61\x62"<<endl;
	cout<<"aa"<<endl;
	while(true)
	{
		bzero(buff, sizeof(buff));
		Recvfrom(listen_sockfd, buff, sizeof(buff), 0, NULL, NULL);
		std::cout<<buff<<std::endl;
	}
	//reg.sendMessage(4, 1, buff, n);
	return 0;
}
